package com.jkd.mapper;

import com.jkd.model.pojo.StuRoomRelate;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface StuRoomRelateMapper {
    @Insert("insert into stu_room_relate(stu_id,other1,room_id,check_in_time,check_out_time,deleted,other2) values(#{stuId},#{other1},#{roomId},#{checkInTime},#{checkOutTime},#{deleted},#{other2})")
    int insert(StuRoomRelate stuRoomRelate);

    @Select("select relate_id from stu_room_relate where stu_id=#{stuId}")
    Integer selectByStuIdAndRoomId(@Param("stuId") Integer stuId);

    @Select("select * from stu_room_relate where room_id = #{roomId}")
    List<StuRoomRelate> selectByRoomId(Integer roomId);
}
